package main

import "sync/atomic"

type Page struct {
	views uint32
}

func (page *Page) SetView(n uint32) {
	atomic.StoreUint32(&page.views, n)
}

func (page *Page) Views() uint32 {
	return atomic.LoadUint32(&page.views)
}

type Page2 struct {
	views atomic.Uint32
}

func (p2 Page2) SetView(n uint32) {
	p2.views.Store(n)
}

func (p2 Page2) Views() uint32 {
	return p2.views.Load()
}
